﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using SIMA.Entities;
using SIMA.Core.Enums;
using SIMA.Core.Security;

namespace SIMA.Services
{
    // NOTA: si cambia aquí el nombre de interfaz "IPerfilService", también debe actualizar la referencia a "IPerfilService" en App.config.
    [ServiceContract]
    public interface IPerfilService
    {
        #region Get Perfiles

        [OperationContract]
        List<T_C_Perfil> GetPerfiles(Profile securityProfile);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetPerfiles(Profile securityProfile, AsyncCallback callback, object state);

        List<T_C_Perfil> EndGetPerfiles(IAsyncResult asyncResult);

        #endregion

        #region Get Perfiles Filtered

        [OperationContract]
        List<T_C_Perfil> GetPerfilesFiltered(Profile securityProfile, FilterType filter);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetPerfilesFiltered(Profile securityProfile, FilterType filter, AsyncCallback callback, object state);

        List<T_C_Perfil> EndGetPerfilesFiltered(IAsyncResult asyncResult);

        #endregion

        #region New Perfiles

        [OperationContract]
        string NewPerfil(Profile securityProfile, T_C_Perfil newPerfil);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginNewPerfil(Profile securityProfile, T_C_Perfil newPerfil, AsyncCallback callback, object state);

        string EndNewPerfil(IAsyncResult asyncResult);

        #endregion

        #region Update Perfiles

        [OperationContract]
        string UpdatePerfil(Profile securityProfile, T_C_Perfil perfilToUpdate, T_C_Perfil perfilUpdated);

        [OperationContract(AsyncPattern=true)]
        IAsyncResult BeginUpdatePerfil(Profile securityProfile, T_C_Perfil perfilToUpdate, T_C_Perfil perfilUpdated, AsyncCallback callback, object state);

        string EndUpdatePerfil(IAsyncResult asyncResult);
        
        #endregion

        #region Delete Perfil

        [OperationContract]
        string DeletePerfil(Profile securityProfile, T_C_Perfil PerfiltoDelete);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginDeletePerfil(Profile securityProfile, T_C_Perfil PerfiltoDelete, AsyncCallback callback, object state);

        string EndDeletePerfil(IAsyncResult asyncResult);

        #endregion

        #region Call Procedure

        [OperationContract]
        List<T_C_Perfil> CallProcedure(Profile securityProfile, string param, CommandType commandType);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginCallProcedure(Profile securityProfile, string param, CommandType commandType, AsyncCallback callback, object state);

        List<T_C_Perfil> EndCallProcedure(IAsyncResult asyncResult);

        #endregion

    }
}
